﻿using System.Collections;
using Unity.Mathematics;
using UnityEngine;

namespace GameBasic
{
    public static class ExtRect
    {
        public static bool Contains(this RectInt rect, int2 position)
        {
            return rect.Contains(new Vector2Int(position.x, position.y));
        }

        public static RectInt Create(int2 position, int2 size)
        {
            return new RectInt(position.x, position.y, size.x, size.y);
        }

        public static ref Rect Translate(ref this Rect rect, Vector2 vect)
        {
            rect.position += vect;
            return ref rect;
        }
    }
}